<ng-container *ngIf="form != null">
    <form [formGroup]="form">
        <div class="form-group">
            <label>Flip Screen</label>
            <input formControlName="flipscreen" type="checkbox">
        </div>
        <!-- <div class="form-group">
            <label>Invert Screen</label>
            <input formControlName="invertscreen" type="checkbox">
        </div> -->
        <div class="form-group">
            <label>WiFi SSID: </label>
            <input formControlName="ssid" type="text">
        </div>
        <div class="form-group">
            <label>WiFi Password: </label>
            <input formControlName="wifiPass" type="password">
        </div>
        <div class="form-group">
            <label>Stratum URL: (Do not include 'stratum+tcp://' or port</label>
            <input formControlName="stratumURL" type="text">
        </div>
        <div class="form-group">
            <label>Stratum Port:</label>
            <input formControlName="stratumPort" type="number">
        </div>
        <div class="form-group">
            <label>Stratum User: </label>
            <input formControlName="stratumUser" type="text">
        </div>

        <ng-container *ngIf="!devToolsOpen && ASICModel == eASICModel.BM1366">

            <div class="form-group">
                <label>Frequency </label>
                <select formControlName="frequency">
                    <option value="400">400</option>
                    <option value="425">425</option>
                    <option value="450">450</option>
                    <option value="475">475</option>
                    <option value="485">485 (default)</option>
                    <option value="500">500</option>
                    <option value="525">525</option>
                    <option value="550">550</option>
                    <option value="575">575</option>
                </select>
            </div>

            <div class="form-group">
                <label>Core Voltage </label>
                <select formControlName="coreVoltage">
                    <option value="1100">1100</option>
                    <option value="1150">1150</option>
                    <option value="1200">1200 (default)</option>
                    <option value="1250">1250</option>
                    <option value="1300">1300</option>
                </select>
            </div>
        </ng-container>

        <ng-container *ngIf="!devToolsOpen && ASICModel == eASICModel.BM1397">

            <div class="form-group">
                <label>Frequency </label>
                <select formControlName="frequency">
                    <option value="400">400</option>
                    <option value="425">425 (default)</option>
                    <option value="450">450</option>
                    <option value="475">475</option>
                    <option value="485">485</option>
                    <option value="500">500</option>
                    <option value="525">525</option>
                    <option value="550">550</option>
                    <option value="575">575</option>
                </select>
            </div>

            <div class="form-group">
                <label>Core Voltage </label>
                <select formControlName="coreVoltage">
                    <option value="1300">1300</option>
                    <option value="1350">1350</option>
                    <option value="1400">1400 (default)</option>
                    <option value="1450">1450</option>
                    <option value="1500">1500</option>
                </select>
            </div>
        </ng-container>

        <ng-container *ngIf="devToolsOpen === true">
            <div class="form-group">
                <label>Frequency </label>
                <input formControlName="frequency" type="number">
            </div>

            <div class="form-group">
                <label>Core Voltage</label>
                <input formControlName="coreVoltage" type="number">
            </div>
        </ng-container>


        <div class="form-group">
            <label>Invert Fan Polarity</label>
            <input formControlName="invertfanpolarity" type="checkbox">
        </div>

        <div class="form-group">
            <label>Automatic Fan Control</label>
            <input formControlName="autofanspeed" type="checkbox">
        </div>


        <div class="form-group" *ngIf="form.controls['autofanspeed'].value != true">
            <label>Fan Speed {{form.controls['fanspeed'].value}}%
                <b *ngIf="form.controls['fanspeed'].value < 33" style="color:red">Danger: Could Cause
                    Overheating</b> <b *ngIf="form.controls['fanspeed'].value == 100" style="color:	#F2A900">S19
                    Simulator</b></label>
            <input formControlName="fanspeed" type="range" [min]="0" [max]="100">
        </div>
        <div class="mt-2">
            <button [disabled]="form.invalid" (click)="updateSystem()" class="btn btn-primary mr-2">Save</button>
            <b style="line-height: 34px;">You must restart this device after saving for changes to take effect.</b>
        </div>


    </form>
</ng-container>